package com.dongdongshop.controller;

import com.dongdongshop.utils.CookieUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class CookieController {

    //cookie用的是request，response请求 是http协议
    //所以不嫩改用在dubbo协议中 seller_service(被调用者)
    @RequestMapping("addCookie")
    @ResponseBody
    public String addCookie(HttpServletRequest request, HttpServletResponse response){
        CookieUtils.setCookie(request,response,"myCookie","helloCookie");
        return "ok";
    }
}
